package com.usian.controller;

import com.usian.entity.ResultClass;
import com.usian.entity.day14.Emp;
import com.usian.service.Empservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
    Date:2023/8/22
    Author:刘帮祺
*/
@RestController
@RequestMapping("/emp")
public class EmpController {
    @Autowired
    private Empservice empservice;
    @RequestMapping("/login")
    public ResultClass login(@RequestBody Emp emp){
        try {
            return empservice.login(emp);
        }catch (Exception e){
            e.printStackTrace();
            return ResultClass.error();
        }
    }
}
